Copyright ã1992 by Scott Hess.  All Rights Reserved.

OSC Examples

OSC sequences add a great deal of flexibility to Stuart, especially the Directory-setting sequence (see Features/Directory).  Here are some examples of how to cause the current directory to be kept up-to-date in the Stuart window from various shells:

Shell	Startup file	Setup commands
bash	~/.bashrc	PROMPT_COMMAND=osc
csh	~/.cshrc	alias cd 'cd \!* ; osc'
		alias popd 'popd \!* ; osc'
		alias pushd 'pushd \!* ; osc'
rc	~/.rcrc	fn prompt { osc }
tcsh	~/.tcshrc	alias cwdcmd osc
zsh	~/.zshrc	function chpwd { osc }

To make use of these sequences, you must have the osc utility installed (see Installation/Utilities).  Then, place the commands for your shell of choice into that shell's startup file, as indicated above.  Otherwise, you can just paste the information to the shell's prompt to test it.

Note:  Simply placing the above sequences in your shell's startup file does not place the current directory into your window's titlebar.  It merely changes the Directory preference associated with the window to the current directory.  To cause the current directory to be displayed in the titlebar, you must have a `%{Directory}' sequence in your titlebar.  Stuart recalculates the titlebar when Directory changes, which will cause the titlebar to track your current directory.